package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ZhuanjiaMapper;
import com.ruoyi.system.domain.Zhuanjia;
import com.ruoyi.system.service.IZhuanjiaService;
import com.ruoyi.common.core.text.Convert;

/**
 * 专家Service业务层处理
 * 
 * @author dy
 * @date 2024-05-29
 */
@Service
public class ZhuanjiaServiceImpl implements IZhuanjiaService 
{
    @Autowired
    private ZhuanjiaMapper zhuanjiaMapper;

    /**
     * 查询专家
     * 
     * @param zhuanjiaid 专家主键
     * @return 专家
     */
    @Override
    public Zhuanjia selectZhuanjiaByZhuanjiaid(String zhuanjiaid)
    {
        return zhuanjiaMapper.selectZhuanjiaByZhuanjiaid(zhuanjiaid);
    }

    /**
     * 查询专家列表
     * 
     * @param zhuanjia 专家
     * @return 专家
     */
    @Override
    public List<Zhuanjia> selectZhuanjiaList(Zhuanjia zhuanjia)
    {
        return zhuanjiaMapper.selectZhuanjiaList(zhuanjia);
    }

    /**
     * 新增专家
     * 
     * @param zhuanjia 专家
     * @return 结果
     */
    @Override
    public int insertZhuanjia(Zhuanjia zhuanjia)
    {
        return zhuanjiaMapper.insertZhuanjia(zhuanjia);
    }

    /**
     * 修改专家
     * 
     * @param zhuanjia 专家
     * @return 结果
     */
    @Override
    public int updateZhuanjia(Zhuanjia zhuanjia)
    {
        return zhuanjiaMapper.updateZhuanjia(zhuanjia);
    }

    /**
     * 批量删除专家
     * 
     * @param zhuanjiaids 需要删除的专家主键
     * @return 结果
     */
    @Override
    public int deleteZhuanjiaByZhuanjiaids(String zhuanjiaids)
    {
        return zhuanjiaMapper.deleteZhuanjiaByZhuanjiaids(Convert.toStrArray(zhuanjiaids));
    }

    /**
     * 删除专家信息
     * 
     * @param zhuanjiaid 专家主键
     * @return 结果
     */
    @Override
    public int deleteZhuanjiaByZhuanjiaid(String zhuanjiaid)
    {
        return zhuanjiaMapper.deleteZhuanjiaByZhuanjiaid(zhuanjiaid);
    }

    /**
     * 专家管理查询统计列表
     */
    @Override
    public List<Map<String,Object>> chaxuntongjilist(String deptid,String xingming,String deptname,String deptlevel,String gongzuodanwei,
                                                     String ruxuannianfen,String zhuanjiazhuangtai,
                                                     String zhuanjiazhuangtaibiandongshijian_kaishi,
                                                     String zhuanjiazhuangtaibiandongshijian_jieshu,
                                                     int pageindex, int pagesize) {
        int mmStartIndex = (pageindex - 1) * pagesize;
        return zhuanjiaMapper.chaxuntongjilist(deptid,xingming,deptname,deptlevel,gongzuodanwei,ruxuannianfen,zhuanjiazhuangtai,
                zhuanjiazhuangtaibiandongshijian_kaishi,zhuanjiazhuangtaibiandongshijian_jieshu,mmStartIndex,pagesize);
    }

    @Override
    public int chaxuntongjilistCount(String deptid,String xingming,String deptname,String deptlevel,String gongzuodanwei,
                                     String ruxuannianfen,String zhuanjiazhuangtai,
                                     String zhuanjiazhuangtaibiandongshijian_kaishi,
                                     String zhuanjiazhuangtaibiandongshijian_jieshu) {
        return zhuanjiaMapper.chaxuntongjilistCount(deptid,xingming,deptname,deptlevel,gongzuodanwei,ruxuannianfen,zhuanjiazhuangtai,
                zhuanjiazhuangtaibiandongshijian_kaishi,zhuanjiazhuangtaibiandongshijian_jieshu);
    }

    /**
     * 专家管理查询统计列表 单位普通管理员
     */
    @Override
    public List<Map<String,Object>> chaxuntongjilistCommon(String deptid,String xingming,String deptname,String deptlevel,String gongzuodanwei,
                                                           String ruxuannianfen,String zhuanjiazhuangtai,
                                                           String zhuanjiazhuangtaibiandongshijian_kaishi,
                                                           String zhuanjiazhuangtaibiandongshijian_jieshu,
                                                           int pageindex, int pagesize) {
        int mmStartIndex = (pageindex - 1) * pagesize;
        return zhuanjiaMapper.chaxuntongjilistCommon(deptid,xingming,deptname,deptlevel,gongzuodanwei,ruxuannianfen,zhuanjiazhuangtai,
                zhuanjiazhuangtaibiandongshijian_kaishi,zhuanjiazhuangtaibiandongshijian_jieshu,mmStartIndex,pagesize);
    }

    @Override
    public int chaxuntongjilistCommonCount(String deptid,String xingming,String deptname,String deptlevel,String gongzuodanwei,
                                           String ruxuannianfen,String zhuanjiazhuangtai,
                                           String zhuanjiazhuangtaibiandongshijian_kaishi,
                                           String zhuanjiazhuangtaibiandongshijian_jieshu) {
        return zhuanjiaMapper.chaxuntongjilistCommonCount(deptid,xingming,deptname,deptlevel,gongzuodanwei,ruxuannianfen,zhuanjiazhuangtai,
                zhuanjiazhuangtaibiandongshijian_kaishi,zhuanjiazhuangtaibiandongshijian_jieshu);
    }

    @Override
    public Map<String, Integer> Countchaxuntongji(String deptid,String xingming,String deptname,String deptlevel,String gongzuodanwei,
                                                  String ruxuannianfen,String zhuanjiazhuangtai,
                                                  String zhuanjiazhuangtaibiandongshijian_kaishi,
                                                  String zhuanjiazhuangtaibiandongshijian_jieshu) {
        return zhuanjiaMapper.Countchaxuntongji(deptid,xingming,deptname,deptlevel,gongzuodanwei,ruxuannianfen,zhuanjiazhuangtai,
                zhuanjiazhuangtaibiandongshijian_kaishi,zhuanjiazhuangtaibiandongshijian_jieshu);
    }

    @Override
    public Map<String, Integer> Countchaxuntongjicommon(String deptid,String xingming,String deptname,String deptlevel,String gongzuodanwei,
                                                        String ruxuannianfen,String zhuanjiazhuangtai,
                                                        String zhuanjiazhuangtaibiandongshijian_kaishi,
                                                        String zhuanjiazhuangtaibiandongshijian_jieshu) {
        return zhuanjiaMapper.Countchaxuntongjicommon(deptid,xingming,deptname,deptlevel,gongzuodanwei,ruxuannianfen,zhuanjiazhuangtai,
                zhuanjiazhuangtaibiandongshijian_kaishi,zhuanjiazhuangtaibiandongshijian_jieshu);
    }
}
